package com.example.kotlin01

import org.junit.Test

const val finalData = "helloword"

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun test() {
        val aChar: Char = '\\'
//        val aInt:Int =5
//        val aLong:Long = aInt.toLong()
//        val aString :String = "a"
//        val aString1:String = String(charArrayOf('a'))
//        println(aString1===aString)
//        //1字符串模板
//        val arg1:Int = 1
//        val arg2:Int = 2
//        println("$arg1+$arg2=${arg1+arg2}")
//        val sayHello:String = "hello \"bod\"";
//        println(sayHello)
//        val money :Int = 1000
////        println("$money")\
//        var isNull:String? = getName()
//        println(isNull.length)
//        var array:IntArray? = intArrayOf(1,2,3)
//        array!!.forEach {
//            data->
//            println(data)
//        }
//        var stringArray:Array<String> = arrayOf("1","2","3")
//        var intArray:Array<Int> = arrayOf(4,5,6)
//        intArray[2] = 7
//        intArray.forEach {
//            data->
//            println(data)
//
//
//
//        }

        var name = myName("hello")
        println(name)

    }

    var myName = fun(name: String): String? {
        return name
    }


    @Test
    fun test2() {

        val data = "ffffffff-8957-918e-ffff-ffffca13f0d5"
        println(data.length)

    }





    var sum = { arg1: Int, arg2: Int ->
        var del = arg1 - 1
        del + arg2
    }

    val sun = { x: Int, y: Int -> x + y }

}
